Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[autodiff] Skip store forwarding to keep the GlobalLoadStmt alive #5315

Merged
merged 7 commits into from
Jul 5, 2022

Conversation

erizmr
Copy link
Contributor

@erizmr erizmr commented Jul 3, 2022

Related issue = #5284
The gradient accumulation to global field only happens when reading it, i.e., GlobalLoadStmt. However, the store forwarding kills some GlobalLoadStmt so that the accumulations for the grad of intermediate variable are skipped (as shown in #5284).

This PR makes the store forwarding skipped when dealing with GlobalLoadStmt who reads a global field with grad.

@netlify
Copy link

netlify bot commented Jul 3, 2022

Deploy Preview for docsite-preview ready!

Name Link
🔨 Latest commit 1da17da
🔍 Latest deploy log https://app.netlify.com/sites/docsite-preview/deploys/62c40c39a3fc2700088afb9b
😎 Deploy Preview https://deploy-preview-5315--docsite-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@erizmr erizmr requested a review from ailzhang July 4, 2022 12:52
Copy link
Contributor

@ailzhang ailzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

taichi/ir/control_flow_graph.cpp Outdated Show resolved Hide resolved
taichi/ir/control_flow_graph.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@ailzhang ailzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@erizmr erizmr merged commit 05e1e48 into taichi-dev:master Jul 5, 2022
@erizmr erizmr deleted the ad_store_forward branch July 6, 2022 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants